<template>
  <section class="app-main">
    <transition name="fade-transform" mode="out-in">
      <router-view :key="key" />
    </transition>
  </section>
</template>

<script>
export default {
  name: "AppMain",
  data() {
    return {};
  },
  computed: {
    key() {
      return this.$route.path;
    }
  }
};
</script>

<style scoped>
.app-main {
  /*50 = navbar  */
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  width: 100%;
  position: relative;
  /* overflow: hidden; */
  overflow-y: scroll;
  padding: 20px;
  background-color: #f0f2f5;
}
.fixed-header + .app-main {
  padding-top: 50px;
}
</style>

<style lang="scss">
// 修复打开el对话框中的css样式错误
.el-popup-parent--hidden {
  .fixed-header {
    padding-right: 15px;
  }
}
</style>
